<?php

/**
 * ContactForm class.
 * ContactForm is the data structure for keeping
 * contact form data. It is used by the 'contact' action of 'SiteController'.
 */
class ContactForm extends CFormModel
{
	public $name;
	public $email;
	public $subject;
	public $body;
	public $verifyCode;
	   
    
	/**
	 * Declares the validation rules.
	 */
	public function rules()
	{
		return array(
			// name, email, subject and body are required
			array('name, email, subject, body', 'required' ),
			// email has to be a valid email address
			array('email', 'email'),
  	       // array('ket_en', 'ket_en'),
            //array('ket_id', 'ket_id'),
          // verifyCode needs to be entered correctly
			array('verifyCode', 'captcha', 'allowEmpty'=>!CCaptcha::checkRequirements()),
		);
	}

	/**
	 * Declares customized attribute labels.
	 * If not declared here, an attribute would have a label that is
	 * the same as its name with the first letter in upper case.
	 */
	public function attributeLabels()
	{
	   $indo = lang() == "id";
		return array(
			'verifyCode'=>'Verification Code',            
			'name' => $indo ? 'Nama' : 'Name',			
			'subject' => $indo ? 'Judul' : 'Subject',
            'body' => $indo ? 'Isi' : 'Body', 
            'verifyCode'=>$indo ? 'Kode Verifikasi' :'Verification Code', 
           	//'submit' => $indo ? 'Kirim' : 'Submit',
            'ket_en'=> $indo ? 'Silahkan masukkan huruf/angka seperti yang tertampil di gambar atas.
    		<br/>Huruf tidak terpengaruh besar kecil.' : 'Please enter the letters as they are shown in the image above.
    		<br/>Letters are not case-sensitive.',
			//'judul' => 'Judul',
//			'body' => 'Body',
//			'pesan' => 'Pesan',
//			'captcha' => 'captcha',
//			'submit' => 'Submit',
//			'kirim' => 'Kirim',
//            'ket_en'=>'Please enter the letters as they are shown in the image above.
//		<br/>Letters are not case-sensitive.',
//            'ket_id'=>'Silahkan masukkan huruf/angka seperti yang tertampil di gambar atas.
//		<br/>Huruf tidak terpengaruh besar kecil.',
        
		);
	}
}